package com.budwk.app.miniapp.controllers.admin;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.budwk.app.miniapp.services.WxSqfwFireHiddenService;
import com.budwk.starter.common.openapi.annotation.*;
import com.budwk.starter.common.page.Pagination;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.log.annotation.SLog;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.*;

import javax.servlet.http.HttpServletRequest;

@IocBean
@At("/platform/miniapp/sqfwFireHidden")
@ApiDefinition(tag = "微信小程序-安全排查")
@Slf4j
public class WxSqfwFireHiddenController {
    @Inject
    private WxSqfwFireHiddenService wxSqfwFireHiddenService;

    @At("/getFireHiddenPdfList")
    @Ok("json")
    @POST
    @ApiOperation(name = "获取安全排查表单列表信息")
    @ApiFormParams(
            {
                    @ApiFormParam(name = "phoneNo", description = "电话号码"),
                    @ApiFormParam(name = "pageNo", description = "页号"),
                    @ApiFormParam(name = "pageSize", description = "页码")
            }
    )
    @SLog(tag = "获取安全排查表单列表信息", value = "${args[0]}")
    @SaCheckLogin
    public Result<?> getFireHiddenPdfList(@Param("phoneNo") String phoneNo,
                                          @Param("pageNo") Integer pageNo,
                                          @Param("pageSize") Integer pageSize, HttpServletRequest req) {
        Pagination pagination = wxSqfwFireHiddenService.getFireHiddenPdfList(phoneNo, pageNo, pageSize);
        return Result.success(pagination);
    }
}
